import Vue from "vue";
import App from "./App";
Vue.config.productionTip = false;
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import i18n from '../plugins/scratch'
Vue.use(ElementUI);

/* eslint-disable no-new */
window.app = new Vue({
  el: "#vueapp",
  i18n,
  render: h => h(App)
});
document.addEventListener("click", function (e) {
  var elem = e.target || e.srcElement;
  while (elem) {
    //循环判断至跟节点，防止点击的是div子元素
    if (elem.class && elem.class == "blocklyBlockBackground") {
      return;
    }
    elem = elem.parentNode;
  }
  document.querySelector(".blocklyDropDownDiv").style.display = "none";
});
